$(function() {
	var imgSrc1 = localStorage["imgSrc"];
	var imgName = localStorage["img-name"];
	var imgmoney = localStorage["img-money"];
	var imgsl = localStorage["img-sl"];
	var imghm = localStorage["img-hm"];
	var xiaoji = imgsl * imgmoney;
	
	
	$("#zongji").text(xiaoji);
	if(imgSrc1==undefined)
	{
		
	}else{
		$(
		'<ul>' +
		'<li class="list_content_left">' +
		'<p class="list_content_img"><img src="' + imgSrc1 + '" alt=""></p>' +
		'<p class="right">' +
		'<span class="right_weight"><a href="">HELMUT LANG</a></span>' +
		'<span><a href="">' + imgName + '</a></span>' +
		'<span><a href="">尺寸：' + imghm + '</a></span>' +
		'</p>' +

		'</li>' +
		'<li id="jiage">' + imgmoney + '</li>' +
		'<li class="number_li">' +
		' <div class="number_choose">' +
		'<span class="number_left"><a href="javascript:void(0)">+</a></span>' +
		'<span class="number"><a href="#" id="gesu">' + imgsl + '</a></span>' +
		'<span class="number_right"><a href="javascript:void(0)">-</a></span>' +
		'</div>' +

		'</li>' +
		'<li class="youhui">' +
		'0' +
		'</li>' +
		'<li id="xiaoji">' +
		xiaoji + '' +
		'</li>' +
		'<li>' +
		'<a href="#" id="delet"><img src="images/icon_delete.png"></a>' +
		'</li>' +
		'</ul>').appendTo($(".list_content"));		
	}
	

	$("#delet").click(function() {

		$("#delet").parent().parent().remove();
		localStorage.removeItem("imgSrc");
		localStorage.removeItem("img-name");
		localStorage.removeItem("img-money");
		localStorage.removeItem("img-sl");
		localStorage.removeItem("img-hm");
		

	})

	var jiage = $("#jiage").html();
	var youhui = $(".youhui").html();
	var geshu = $("#gesu").html();
	var xiaoji = geshu * jiage - youhui;
	

	$(".number_right").click(function() {
		var s = $("#gesu").text();
		var z = s - 1;
		if(s == 1) {
			z = 1
		}
		$("#gesu").html(z);
		localStorage["img-sl"] = $("#gesu").text();
		var imgsl = localStorage["img-sl"];
		xiaoji = imgsl * jiage;
		$("#xiaoji").html(xiaoji);
		$("#zongji").html(xiaoji);
	})
	$(".number_left").click(function() {
		var s = parseInt($("#gesu").text());
		var z = s + 1;
		if(s == 5) {
			z = 5

		}
		$("#gesu").html(z);
		localStorage["img-sl"] = $("#gesu").text();
		var imgsl = localStorage["img-sl"];
		xiaoji = imgsl * jiage;
		$("#xiaoji").html(xiaoji);
		$("#zongji").html(xiaoji);
	})
	
	
	$(".button4").click(function(){
		window.location.href="qrddy.html";
		
		
	})

})